package jdbc;
import jdbc.InputUtil.InputField;
public class UserInfo {
    @InputField(title="用户名",notNull = true,
                regex = ".{1,30}",
                regexNotMathTitle = "用户名长度应为1-30个",
                mode = {"登录","注册"})
    private String username;

    @InputField(title="请输入密码",notNull = true,
            regex = ".{1,30}",
            regexNotMathTitle = "密码长度应为1-30个",
            mode = {"登录","注册"})
    private String password;

    @InputField(title="昵称",notNull = true,
            regex = ".{1,30}",
            regexNotMathTitle = "昵称长度应为1-30个",
            mode={"注册"})
    private String nickname;

    @InputField(title="年龄",
            regex = "[0-9]{1,3}",
            regexNotMathTitle = "年龄应为3位以内整数",
            mode={"注册"})
    private int age;

    public UserInfo(){}
    public UserInfo(String username, String password, String nickname, int age) {
        this.username = username;
        this.password = password;
        this.nickname = nickname;
        this.age = age;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    /* public String getUsername() {
            return username;
        }

        public String getPassword() {
            return password;
        }

        public String getNickname() {
            return nickname;
        }

        public int getAge() {
            return age;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public void setPassword(String password) {
            this.password = password;
        }

        public void setNickname(String nickname) {
            this.nickname = nickname;
        }

        public void setAge(int age) {
            this.age = age;
        }
    */
    @Override
    public String toString() {
        return "UserInfo{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", nickname='" + nickname + '\'' +
                ", age=" + age +
                '}';
    }
}
